package 多线程练习.线程池;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

class Number implements Runnable{
      @Override
      public void run() {
            for(int i=0;i<=100;i++){
                  if(i%2==0){
                        if(i!=0){
                              System.out.println(i);
                        }
                        continue;
                  }
            }
      }
}

public class ThreadPool {
      public static void main(String[] args) {

            ExecutorService executorService = Executors.newFixedThreadPool(5);
            executorService.execute(new Number());//适用于Runnable
//            executorService.submit();//使用于Callable
            executorService.shutdown();
      }
}
